-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ModalManager] Fix aria-hidden of modal current node #13082
[ModalManager] Fix aria-hidden of modal current node #13082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include a test that would fail without the fix. It seems like we either don't test at all if the opened modal has aria-hidden="false"
or the test is not constructed right.
mount = [].concat(mount); // eslint-disable-line no-param-reassign | ||
[].forEach.call(container.children, node => { | ||
if (mount.indexOf(node) === -1 && isHidable(node)) { | ||
if (mount.indexOf(node) === -1 && node !== currentNode && isHidable(node)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think mount.indexOf
wanted to do the same as node !== currentNode
. Could you find out what the difference between those two expressions is and add some documentation? That might be the actual bug here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That mount.indexOf works if we give it the currentNode instead of mountNode. Is that desired?
@@ -20,14 +20,14 @@ export function ariaHidden(show, node) { | |||
if (show) { | |||
node.setAttribute('aria-hidden', 'true'); | |||
} else { | |||
node.removeAttribute('aria-hidden'); | |||
node.setAttribute('aria-hidden', 'false'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this necessary for the fix? If not I'd rather not change this.
When the element is presented, authors MUST set the aria-hidden attribute to false or remove the attribute [...]
--- W3 WAI-ARIA
Seems like it shouldn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was in the 'Expected Behavior' of the issue
Interesting issue, I will give a close look at what's happening in the documentation. |
I gave a close look at the issue. Here is a quick overview of what's happening:
So, we rely on the double rendering phase to correctly set the aria-hidden attributes. It's brittle, it doesn't work if the modal is already mounted. Remembers me #12831. I have also noticed another issue. If we use the |
@J-Kallunki Alright, let's get this fix in master. I'm looking at it now. |
…d modal will get aria-hidden true.
4952711
to
7874372
Compare
7874372
to
5f1e6f8
Compare
@J-Kallunki Thank you! It's a shame we had this issue that long ♿️👼. |
Hi!
This PR resolves #12710.
Fixed aria-hidden siblings functions to not alter current node and set proper for modal current node.
It uses aria-hidden='false' with modals instead of removing the property.